package org.ocelot.tunes4j.beans;


import java.util.ArrayList;
import java.util.List;

import org.apache.commons.beanutils.BeanUtils;

public class PlayList {
	private int id;
	private String name;
	private List<AudioObject> mediaItems = new ArrayList<AudioObject>();
	
	public PlayList(){
	}
	
	public PlayList(String name) {
		this.name = name;
	}
	
	public String getName() {
		return name;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void addMediaItem(AudioObject item) {
		mediaItems.add(item);
	}
	
	public List<AudioObject> getMediaItems() {
		return mediaItems;
	}
	public void setMediaItems(List<AudioObject> mediaItems) {
		this.mediaItems=mediaItems;
	}
	
	public String toString() {
		try {
			return BeanUtils.describe(this).toString();
		} catch (Exception e) {
			System.out.println("Error converting object to String" + e.toString());
			e.printStackTrace();
		}
		return super.toString();
	}
	
}
